package com.syc.sqlsession;

import java.util.List;

/**
 * 创建sqlSession接口,遵循开闭原则,利于扩展
 *
 * @author Shen Yu Chen
 * @create 2020-04-23
 **/
public interface SqlSession {

    //查询多条
    public <E> List<E> selectList(String statementId, Object... params) throws Exception;

    //查询一条
    public <T> T selectOne(String statementId, Object... params) throws Exception;

    //基于jdk动态代理为Dao接口生成代理实现类
    public <T> T getMapper(Class<?> mapperClass);

    //插入
    int insert(String statementId, Object... params)throws Exception;

    //更新
    int update(String statementId, Object... params)throws Exception;

    //删除
    int delete(String statementId, Object... params)throws Exception;
}
